home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_01_07
/
1n07034b
< prev
next >
Wrap
Text File
|
1990-11-14
|
433b
|
26 lines
LISTING 2
/* routine to read data that is
available on the network descriptor
nd. reads len bytes of data.
*/
#define BUFFSIZE 512
void read_data(int nd)
{
char buffer[BUFFSIZE];
do {
len = net_read(nd,
buffer, BUFFSIZE,
(struct addr *) NULL, 0);
if (len < 0)
pneterror("net_read");
else
write(file, buffer, len);
} while (len >= 0);
}